package com.eedi.framework.org.dal.mapper;

import com.eedi.framework.common.enums.CommonStatusEnum;
import com.eedi.framework.mybatis.core.mapper.BaseMapperX;
import com.eedi.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.eedi.framework.org.dal.dataobject.SysOrgConfigPlacardDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SysOrgConfigPlacardMapper extends BaseMapperX<SysOrgConfigPlacardDO> {

    default SysOrgConfigPlacardDO selectByPlacardId(String orgConfigId,String orgConfigPlacardId){
        LambdaQueryWrapperX<SysOrgConfigPlacardDO> queryWrapper = new LambdaQueryWrapperX<>();
        queryWrapper.eq(SysOrgConfigPlacardDO::getOrgConfigId, orgConfigId)
                .eq(SysOrgConfigPlacardDO::getOrgConfigPlacardId, orgConfigPlacardId)
                .eq(SysOrgConfigPlacardDO::getPlacardStatus, CommonStatusEnum.ENABLE)
                .orderByAsc(SysOrgConfigPlacardDO::getPlacardSort);
        return this.selectOne(queryWrapper);
    }
}
